﻿<% error_messages_for 'subject' %>

<!--[form:subject]-->
<p><label for="subject_no">No</label><br/>
<%= text_field 'subject', 'no'  %></p>

<p><label for="subject_name">Name</label><br/>
<%= text_field 'subject', 'name'  %></p>

<p><label for="subject_parent_id">上级科目</label><br/>
<select name="subject[parent_id]">
  <option value=0> -</option>
  <% (Subject.find(:all,:conditions => "parent_id=0" )).each do |s| %>
    <option value="<%=s.id  %>"
       <%='selected' if s.id ==@subject.parent_id %>>
        <%=s.name%>
    </option>
  <% end %>
</select>
</p>
<!--[eoform:subject]-->